Move With

Entity-Related Move Logic Statement

Syntax samples

MOVE WITH <res1> {,p1}
OR <res2> {,p1}
{FOR <time >} {THEN FREE}

MOVE WITH Technician, 100

MOVE WITH Operator1, 399 FOR 3 min

MOVE WITH Truck1, 99 THEN FREE

MOVE WITH Operator1 OR Operator2

Description

This statement is used to move an entity using a designated resource such as a person or forklift. With the OR operator, you can designate alternative resources for making the move. In this case, the statement captures the first available resource designated in its expression and makes the move. As soon as the destination becomes available, the entity implicitly gets the resource. However, if one of the resources is already owned by the entity, it will use that resource.

It also allows you to set the priority (p1) for accessing the designated resource. If the resource is already owned by the entity, this priority is ignored.

If the resource is static, you may specify a time (FOR <time expression>) for the move. If a resource is dynamic, a time (FOR <time expression>) is not valid. If you use "FOR <time>" with a dynamic resource, you will receive a run-time error. The resource will travel based on either the time or speed/distance defined in the path networks module.

The resource used to make the move is freed only if the THEN FREE option is used.

Valid In

This statement is valid only in Move Logic. MOVE WITH may only be encountered once by an entity in the same move logic.

Components

<res1>

Resource to be captured and used to transport the entity.

<res2>

Alternate resource to be captured and used to transport the entity.

<priority>

The priority for accessing the resource. If the resource is already owned by the entity, this priority is ignored.

<time>

The length of time the system takes to execute the move. Used only if the resource is static. This expression is evaluated whenever the statement is encountered. If no time unit is specified, the default time unit specified in the General Information dialog is applied.

Example

An entity moving from Station A to Station B may use either Tech1 or Tech2 to move the entity depending on which one is available first. The resource is freed after the move.

MOVE WITH Tech1 OR Tech2 THEN FREE

 

The same thing could be accomplished in longer form:

GET Tech1 OR Tech2

MOVE WITH OwnedResource()

FREE OwnedResource()

See Also

MOVE FOR and MOVE ON. Also see Routing Move Logic.